package org.example.visitor;

public class ColorVisitor implements IVisitor{
    @Override
    public void visit(ChairProduct product) {
        System.out.println("visit " + product.getClass().getName() + "'s color " + product.getColor());
    }

    @Override
    public void visit(DeskProduct product) {
        System.out.println("visit " + product.getClass().getName() + "'s color " + product.getColor());
    }

    @Override
    public void visit(ComputerProduct product) {
        System.out.println("visit " + product.getClass().getName() + "'s color " + product.getColor());
    }
}
